package edu.zut.cs.network;

import java.util.Scanner;

public class ArraysDemo1 {

    /*
     * @param args
     */
    public static void main(String[] args) {
        int[][] scores = new int[10][3];
        String[][] level = new String[10][3];
//        成绩输入
        for (int i = 0; i < scores.length; i++) {
            for (int j = 0; j < scores[i].length; j++) {
                System.out.println("请输入第" + (i + 1) + "个学生第" + (j + 1) + "门的成绩");
                Scanner input = new Scanner(System.in);
                scores[i][j] = input.nextInt();
            }
        }
//        成绩评定
        for (int i = 0; i < scores.length; i++) {
            for (int j = 0; j < scores[i].length; j++) {
                if (scores[i][j] >= 0 && scores[i][j] <= 100) {
                    if (scores[i][j] >= 90)
                        level[i][j] = "优秀";
                    else if (scores[i][j] >= 60)
                        level[i][j] = "合格";
                    else
                        level[i][j] = "不合格";
                }
                else{
                    level[i][j] = "成绩输入不合法";
                    }
                }
            }
        //        遍历成绩
        for (int i = 0; i < scores.length; i++) {
            System.out.println("第" + (i + 1) + "个学生的成绩如下：");
            for (int j = 0; j < scores[i].length; j++) {
                System.out.print("第" + (j + 1) + "门成绩：" +scores[i][j]+ "  成绩评定等级："+level[i][j]+"　");
            }
            System.out.println();
        }
    }
}
